home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Miami / Install_Miami < prev    next >
Text File  |  1999-10-29  |  16KB  |  590 lines

  1. ; $VER: Install_Miami 3.2b2 (29.10.99)
  2. (procedure P-check-system-version
  3.  (if (< (/ @installer-version 65536) 43)
  4.   (abort "The Miami installation script needs Installer\n"
  5.    "version 43 or higher. It is available from Aminet\n"
  6.    "and from www.nordicglobal.com")
  7.  )
  8.  (set #exec-version (/ (getversion) 65536))
  9.  (if (< #exec-version 37)
  10.   (abort "Miami needs Kickstart 2.04 or higher.\n")
  11.  )
  12.  (if (< #exec-version 39)
  13.   (set #ag-browser "AmigaGuide")
  14.   (set #ag-browser "MultiView")
  15.  )
  16.  (set #wb-version (/ (getversion "LIBS:workbench.library") 65536))
  17. )
  18.  
  19. (procedure P-select-destination-directory
  20.  (if (exists "Miami:" (noreq))
  21.   (
  22.    (set #old-miami-assign 1)
  23.    (set #old-miami-assign-location (expandpath "Miami:"))
  24.    (set @default-dest
  25.     (askdir
  26.      (prompt "Select the directory where you want to "
  27.       "install Miami 3.2b. You already have a 'Miami:' "
  28.       "assign on your system, so it is assumed that this "
  29.       "is the location of an older version of Miami that "
  30.       "you want to upgrade.")
  31.      (help "Select the directory where you want to "
  32.       "install Miami 3.2b. Since you already have a 'Miami:' "
  33.       "assign on your system you should probably accept "
  34.       "the default.")
  35.      (default "Miami:")
  36.     )
  37.    )
  38.   ) (
  39.    (set #old-miami-assign 0)
  40.    (if (exists "Work:" (noreq))
  41.     (set @default-dest "Work:")
  42.     (set @default-dest "SYS:")
  43.    )
  44.    (set @default-dest
  45.     (askdir
  46.      (prompt "Select the directory where you want to "
  47.       "install Miami 3.2b. An additional directory "
  48.       "will *NOT* be created at the location you specify.")
  49.      (help "Select the directory where you want to "
  50.       "install Miami 3.2b. All necessary files will be copied "
  51.       "to that directory during installation. A new directory "
  52.       "will *NOT* be created at the location you specify. "
  53.       "This means if you want Miami to be installed in its "
  54.       "own directory then you need to create that directory "
  55.       "yourself first.")
  56.      (default @default-dest)
  57.     )
  58.    )
  59.   )
  60.  )
  61.  (makeassign "Miami" @default-dest)
  62. )
  63.  
  64. (procedure P-select-binary
  65.  (set #cpu-choice (if (patmatch "68000|68010" (database "cpu")) 0 1))
  66.  (set #cpu-choice
  67.   (askchoice
  68.    (prompt "Please select which version of\nMiami you want to use:")
  69.    (help "Miami exists in a 68000 version,\n and a 68020 version.\n"
  70.     "One of these versions will be installed.")
  71.    (choices "68000/010 version" "68020/030/040/060 version")
  72.    (default #cpu-choice)
  73.   )
  74.  )
  75. )
  76.  
  77. (procedure P-check-binary
  78.  (set #bin-choice
  79.   (select #cpu-choice
  80.    "000/Miami.000"
  81.    "020/Miami.020"
  82.   )
  83.  )
  84.  (if (not (exists (tackon #source-dir #bin-choice)))
  85.   (abort "Before you can install Miami you first need to\n"
  86.    "download and unpack the archive that contains the Miami\n"
  87.    "binary you want to install.")
  88.  )
  89. )
  90.  
  91. (procedure P-select-guis
  92.  (set #gui-options
  93.   (askoptions
  94.    (prompt "Please select which GUI modules you want to use with Miami. The "
  95.     "MUI and MUIMWB modules need MUI 3.8 or higher, which has to be installed "
  96.     "BEFORE installing Miami. The ClassAct modules require ClassAct, preferably "
  97.     "the version included in OS 3.5.")
  98.    (help "Miami supports several different user interface engines: "
  99.     "MUI, MUIMWB (a version of the MUI module with additional images, "
  100.     "for screens with 8 or more colors), GTLayout "
  101.     "(using gtlayout.library, creating GadTools gadgets) and ClassAct "
  102.     "(should only be used with the OS 3.5 version of ClassAct, because "
  103.     "earlier versions may cause incorrect behavior with some gadgets). Please select "
  104.     "which ones you want to install.")
  105.    (choices "MUI" "MUIMWB (MUI with MagicWB-style images)" "GTLayout" "ClassAct")
  106.   )
  107.  )
  108.  (if (= #gui-options 0)
  109.   (abort "You need to install at least one GUI module.")
  110.  )
  111.  (if (not (= 0 (BITAND #gui-options 3))) (
  112.   (if (not (exists "MUI:Libs/muimaster.library" (noreq)))
  113.    (abort "You need to install MUI 3.8 before you can install GUI "
  114.     "modules for Miami.")
  115.   )
  116.   (if (< (/ (getversion "MUI:Libs/muimaster.library") 65536) 18)
  117.    (abort "Your installed MUI version is too old for Miami 3.0. "
  118.     "Please upgrade to MUI 3.8 or higher before installing Miami."
  119.    )
  120.   )
  121.  ))
  122.  (if (not (= 0 (BITAND #gui-options 8))) (
  123.   (if (< #wb-version 44) (
  124.    (message "NOTE: When using the ClassAct GUI module it is "
  125.     "VERY STRONGLY RECOMMENDED to have the ClassAct "
  126.     "distribution that comes with OS 3.5 or a later version installed. "
  127.     "Earlier versions of ClassAct can cause incorrect behavior "
  128.     "of some user interface elements, such as passwords being "
  129.     "visible or gadgets not reacting to changes in certain "
  130.     "situations."
  131.    )
  132.   ))
  133.  ))
  134. )
  135.  
  136. (procedure P-check-gui
  137.  (if (not (exists (tackon #source-dir #current-gui)))
  138.   (abort "Before you can install Miami you first need to\n"
  139.    "download and unpack the archives that contain the Miami\n"
  140.    "GUI modules you want to install.")
  141.  )
  142. )
  143.  
  144. (procedure P-check-guis
  145.  (if (= 1 (BITAND #gui-options 1)) (
  146.   (set #current-gui "MUI")
  147.   (P-check-gui)
  148.  ))
  149.  (if (= 2 (BITAND #gui-options 2)) (
  150.   (set #current-gui "MUI")
  151.   (P-check-gui)
  152.  ))
  153.  (if (= 4 (BITAND #gui-options 4)) (
  154.   (set #current-gui "GTLayout")
  155.   (P-check-gui)
  156.  ))
  157.  (if (= 8 (BITAND #gui-options 8)) (
  158.   (set #current-gui "ClassAct")
  159.   (P-check-gui)
  160.  ))
  161. )
  162.  
  163.  
  164. (procedure P-select-gui
  165.  (if (= 4 (BITAND #gui-options 4))
  166.   ((set #gui-choice-gtlayout "GTLayout") (set #gui-choice 2))
  167.   (set #gui-choice-gtlayout "")
  168.  )
  169.  (if (= 8 (BITAND #gui-options 8))
  170.   ((set #gui-choice-classact "ClassAct") (set #gui-choice 3))
  171.   (set #gui-choice-classact "")
  172.  )
  173.  (if (= 1 (BITAND #gui-options 1))
  174.   ((set #gui-choice-mui "MUI") (set #gui-choice 0))
  175.   (set #gui-choice-mui "")
  176.  )
  177.  (if (= 2 (BITAND #gui-options 2))
  178.   ((set #gui-choice-muimwb "MUIMWB") (set #gui-choice 1))
  179.   (set #gui-choice-muimwb "")
  180.  )
  181.  (set #gui-choice
  182.   (askchoice
  183.    (prompt "Please select which GUI module you want to use as the default "
  184.     "module for Miami")
  185.    (help "Miami supports several different user interface engines: "
  186.     "MUI, MUIMWB (a version of the MUI module with additional images, "
  187.     "for screens with 8 or more colors), and GTLayout "
  188.     "(using gtlayout.library, creating GadTools gadgets). Please select "
  189.     "which one you want to use as the default. Only modules that you "
  190.     "selected for installation earlier can be used. Note: If you have already "
  191.     "saved the settings with a Miami version 2.9 or higher then the GUI module "
  192.     "you seleted in Miami overrides the choice you make here.")
  193.    (choices #gui-choice-mui #gui-choice-muimwb #gui-choice-gtlayout #gui-choice-classact)
  194.    (default #gui-choice)
  195.   )
  196.  )
  197.  (set #gui-choice-name (select #gui-choice "MUI" "MUIMWB" "GTLayout" "ClassAct"))
  198. )
  199.  
  200. (procedure P-select-icon
  201.  (if (>= #wb-version 44)
  202.   (set #icon-choice-os35 "OS 3.5")
  203.   (set #icon-choice-os35 "")
  204.  )
  205.  (set #icon-choice
  206.   (askchoice
  207.    (prompt "Please select which icons you\nwant to use for Miami and\n"
  208.     "the utility programs:")
  209.    (help "Miami comes with four different\nicon styles. Please select\n"
  210.     "the one you prefer.")
  211.    (choices "do not install new icons" "standard" "Magic Workbench" "NewIcons"
  212.     #icon-choice-os35)
  213.   )
  214.  )
  215. )
  216.  
  217. (procedure P-copy-file
  218.  (copyfiles
  219.   (source (tackon #source-dir #to-copy))
  220.   (dest @default-dest)
  221.   (optional force)
  222.  )
  223. )
  224.  
  225. (procedure P-set-tooltypes
  226.  (if (not (= #icon-choice 0)) (
  227.   (tooltype
  228.    (dest (tackon @default-dest "Miami"))
  229.    (noposition)
  230.   )
  231.   (tooltype
  232.    (dest (tackon @default-dest "MiamiInit"))
  233.    (noposition)
  234.   )
  235.   (tooltype
  236.    (dest (tackon @default-dest "MiamiRegister"))
  237.    (noposition)
  238.   )
  239.   (tooltype
  240.    (dest (tackon @default-dest "Miami.guide"))
  241.    (noposition)
  242.    (setdefaulttool #ag-browser)
  243.   )
  244.  ))
  245. )
  246.  
  247. (procedure P-add-to-startup
  248.  (if #old-miami-assign
  249.   (if (= (#old-miami-assign-location (expandpath @default-dest)))
  250.    (set #change-startup 0)
  251.    (set #change-startup 1)
  252.   )
  253.   (set #change-startup 1)
  254.  )
  255.  (if #change-startup
  256.   (
  257.    (set #startup-addition (cat
  258.     "assign Miami: \"" (expandpath @default-dest) "\"\n"
  259.     )
  260.    )
  261.    (if
  262.     (askbool
  263.      (prompt "It is NECESSARY that an assign "
  264.       "'Miami:' is created for the Miami installation "
  265.       "directory. Would you like Installer "
  266.       "to make the required change to your user-startup "
  267.       "file ? If you answer 'No' then you need to make the "
  268.       "addition yourself, manually, before you can use Miami.")
  269.      (help "It is NECESSARY that an assign "
  270.       "'Miami:' is created for the Miami installation "
  271.       "directory. Would you like Installer "
  272.       "to make the required change to your user-startup "
  273.       "file ? If you answer 'No' then you need to make the "
  274.       "addition yourself, manually, before you can use Miami. "
  275.       "You should only answer with 'No' if you prefer to edit "
  276.       "the user-startup file yourself. If you answer 'No' then "
  277.       "a file 'addition-to-user-startup' will be created in the "
  278.       "Miami installation directory instead. You need to add the "
  279.       "contents of that file to your user-startup file.")
  280.      (choices "Yes" "No")
  281.     )
  282.     (startup "Miami"
  283.      (command #startup-addition)
  284.      (prompt "Installer will modify your s:user-startup "
  285.       "script. The following lines will be added:\n\n"
  286.       #startup-addition)
  287.      (help "Installer will modify your s:user-startup "
  288.       "script. The following lines will be added:\n\n"
  289.       #startup-addition)
  290.     )
  291.     (textfile
  292.      (dest (tackon @default-dest "addition-to-user-startup"))
  293.      (append #startup-addition)
  294.     )
  295.    )
  296.   )
  297.  )
  298. )
  299.  
  300. (procedure P-set-envvars
  301.  
  302.  (set #env-equal-envarc (= (expandpath "ENV:") (expandpath "ENVARC:")))
  303.  (if (not (exists "ENV:MIAMI"))
  304.   (makedir "ENV:MIAMI")
  305.  )
  306.  (if (not #env-equal-envarc)
  307.   (if (not (exists "ENVARC:MIAMI"))
  308.    (makedir "ENVARC:MIAMI")
  309.   )
  310.  )
  311.  (textfile
  312.   (dest "ENV:MIAMI/GUI")
  313.   (append #gui-choice-name)
  314.  )
  315.  (if (not #env-equal-envarc)
  316.   (copyfiles
  317.    (source "ENV:MIAMI/GUI")
  318.    (dest "ENVARC:MIAMI")
  319.   )
  320.  )
  321. )
  322.  
  323.  
  324. (welcome "Welcome to the Miami 3.2b installation.\n")
  325.  
  326. (set app-name "Miami 3.2b")
  327.  
  328. (P-check-system-version)
  329.  
  330. (if @pretend
  331.   (abort "Pretend mode cannot be used with this\n"
  332.    "installation script.")
  333. )
  334.  
  335. (complete 0)
  336.  
  337. (set #source-dir (if (= 1 (exists @icon)) (pathonly (expandpath @icon))
  338.  (expandpath @icon))
  339. )
  340.  
  341. (P-select-destination-directory)
  342.  
  343. (complete 5)
  344.  
  345. (P-select-binary)
  346.  
  347. (P-check-binary)
  348.  
  349. (complete 10)
  350.  
  351. (P-select-icon)
  352.  
  353. (complete 15)
  354.  
  355. (P-select-guis)
  356.  
  357. (P-select-gui)
  358.  
  359. (P-check-guis)
  360.  
  361. (complete 20)
  362.  
  363. ; start actual installation
  364.  
  365. ; delete obsolete files from older Miami versions
  366. (delete (tackon @default-dest "MiamiRemind.doc") (optional force))
  367. (delete (tackon @default-dest "MiamiInitSANA2") (optional force) (infos))
  368. (delete (tackon @default-dest "Miami.000") (optional force) (infos))
  369. (delete (tackon @default-dest "Miami.020") (optional force) (infos))
  370. (delete (tackon @default-dest "Miami.eval") (optional force) (infos))
  371.  
  372. (complete 25)
  373.  
  374. ; copy Miami binary selected by user
  375. (set #to-copy (select #cpu-choice "000/Miami.000" "020/Miami.020"))
  376. (copyfiles
  377.  (source (tackon #source-dir #to-copy))
  378.  (dest @default-dest)
  379.  (newname "Miami")
  380.  (optional force)
  381. )
  382.  
  383. (complete 30)
  384.  
  385. ; copy individual files
  386. (set #to-copy "main/CHANGES") (P-copy-file)
  387. (set #to-copy "main/Miami.guide") (P-copy-file)
  388. (set #to-copy "main/MiamiArp") (P-copy-file)
  389. (set #to-copy "main/MiamiFinger") (P-copy-file)
  390. (set #to-copy "main/MiamiIfConfig") (P-copy-file)
  391. (set #to-copy "main/MiamiInit") (P-copy-file)
  392. (complete 40)
  393. (set #to-copy "main/MiamiMapMBone") (P-copy-file)
  394. (set #to-copy "main/MiamiMRInfo") (P-copy-file)
  395. (set #to-copy "main/MiamiMRouteD") (P-copy-file)
  396. (set #to-copy "main/MiamiMTrace") (P-copy-file)
  397. (set #to-copy "main/MiamiNetStat") (P-copy-file)
  398. (set #to-copy "main/MiamiPing") (P-copy-file)
  399. (set #to-copy "main/MiamiRegister") (P-copy-file)
  400. (complete 50)
  401. (set #to-copy "main/MiamiRemind") (P-copy-file)
  402. (set #to-copy "main/MiamiResolve") (P-copy-file)
  403. (set #to-copy "main/MiamiRoute") (P-copy-file)
  404. (set #to-copy "main/MiamiSysCtl") (P-copy-file)
  405. (set #to-copy "main/MiamiTCPDump") (P-copy-file)
  406. (set #to-copy "main/MiamiTraceRoute") (P-copy-file)
  407.  
  408. (complete 60)
  409.  
  410. ; copy libraries
  411. (if (not (exists (tackon @default-dest "Libs")))
  412.  (makedir (tackon @default-dest "Libs"))
  413. )
  414. (copyfiles
  415.  (source (tackon #source-dir "main/Libs"))
  416.  (dest (tackon @default-dest "Libs"))
  417.  (optional force)
  418.  (all)
  419. )
  420.  
  421. (complete 65)
  422.  
  423. ; copy MNI drivers
  424. (if (not (exists (tackon @default-dest "MNI")))
  425.  (makedir (tackon @default-dest "MNI"))
  426. )
  427. (copyfiles
  428.  (source (tackon #source-dir "main/MNI"))
  429.  (dest (tackon @default-dest "MNI"))
  430.  (optional force)
  431.  (all)
  432. )
  433.  
  434. (complete 70)
  435.  
  436. ; copy GUI modules
  437. (if (= 1 (BITAND #gui-options 1)) (
  438.  (copyfiles
  439.   (source (tackon #source-dir "MUI/MUI.MiamiGui"))
  440.   (dest (tackon @default-dest "Libs"))
  441.   (optional force)
  442.  )
  443.  (copyfiles
  444.   (source (tackon #source-dir "MUI/MUI.MiamiToolsGui"))
  445.   (dest (tackon @default-dest "Libs"))
  446.   (optional force)
  447.  )
  448. ))
  449.  
  450. (if (= 2 (BITAND #gui-options 2)) (
  451.  (run (cat "\"" (tackon #source-dir "MUI/spatch") "\" -oRAM:MUIMWB.MiamiGui \"-p"
  452.   (tackon #source-dir "MUI/MUIMWB.pch") "\" \"" (tackon #source-dir "MUI/MUI.MiamiGui") "\""))
  453.  (copyfiles
  454.   (source "RAM:MUIMWB.MiamiGui")
  455.   (dest (tackon @default-dest "Libs"))
  456.   (optional force)
  457.   (all)
  458.  )
  459.  (delete "RAM:MUIMWB.MiamiGui")
  460.  (copyfiles
  461.   (source (tackon #source-dir "MUI/MUI.MiamiToolsGui"))
  462.   (dest (tackon @default-dest "Libs"))
  463.   (optional force)
  464.  )
  465. ))
  466.   
  467. (if (= 4 (BITAND #gui-options 4)) (
  468.  (copyfiles
  469.   (source (tackon #source-dir "GTLayout/GTLayout.MiamiGui"))
  470.   (dest (tackon @default-dest "Libs"))
  471.   (optional force)
  472.  )
  473.  (copyfiles
  474.   (source (tackon #source-dir "GTLayout/GTLayout.MiamiToolsGui"))
  475.   (dest (tackon @default-dest "Libs"))
  476.   (optional force)
  477.  )
  478.  (copylib
  479.   (source (tackon #source-dir "GTLayout/gtlayout.library"))
  480.   (dest "LIBS:")
  481.   (prompt "The Installer is about to install gtlayout.library "
  482.   "in your LIBS: directory.")
  483.   (help "The GTLayout GUI module needs gtlayout.library for layout generation. "
  484.   "If you skip this step during the installation, you have to "
  485.   "install gtlayout.library manually somewhere within your LIBS: "
  486.   "assign.")
  487.   (confirm)
  488.  )
  489. ))
  490.  
  491. (if (= 8 (BITAND #gui-options 8)) (
  492.  (copyfiles
  493.   (source (tackon #source-dir "ClassAct/ClassAct.MiamiGui"))
  494.   (dest (tackon @default-dest "Libs"))
  495.   (optional force)
  496.  )
  497.  (copyfiles
  498.   (source (tackon #source-dir "ClassAct/ClassAct.MiamiToolsGui"))
  499.   (dest (tackon @default-dest "Libs"))
  500.   (optional force)
  501.  )
  502. ))
  503.  
  504. (complete 80)
  505.  
  506. ; set icons
  507.  
  508. (if (not (= #icon-choice 0)) (
  509.  (set #to-copy
  510.   (select #icon-choice
  511.    ""
  512.    "main/Icons/Standard/Miami.info"
  513.    "main/Icons/MagicWB/Miami.info"
  514.    "main/Icons/NewIcons/Miami.info"
  515.    "main/Icons/OS3.5/Miami.info"
  516.   )
  517.  )
  518.  (copyfiles
  519.   (source (tackon #source-dir #to-copy))
  520.   (dest @default-dest)
  521.  )
  522.  (copyfiles
  523.   (source (tackon #source-dir #to-copy))
  524.   (dest @default-dest)
  525.   (newname "MiamiInit.info")
  526.  )
  527.  (copyfiles
  528.   (source (tackon #source-dir #to-copy))
  529.   (dest @default-dest)
  530.   (newname "MiamiRegister.info")
  531.  )
  532.  (copyfiles
  533.   (source (tackon #source-dir #to-copy))
  534.   (dest "ENV:Sys")
  535.   (newname "def_MiamiApp.info")
  536.  )
  537.  (copyfiles
  538.   (source (tackon #source-dir #to-copy))
  539.   (dest "ENV:Sys")
  540.   (newname "def_MiamiAppOnline.info")
  541.  )
  542.  (copyfiles
  543.   (source (tackon #source-dir #to-copy))
  544.   (dest "ENVARC:Sys")
  545.   (newname "def_MiamiApp.info")
  546.  )
  547.  (copyfiles
  548.   (source (tackon #source-dir #to-copy))
  549.   (dest "ENVARC:Sys")
  550.   (newname "def_MiamiAppOnline.info")
  551.  )
  552.  (set #to-copy "main/CHANGES.info") (P-copy-file)
  553.  (set #to-copy "main/Miami.guide.info") (P-copy-file)
  554.  (if (>= #icon-choice 3) (
  555.   (if (exists "ENV:Sys/def_amigaguide.info")
  556.    (copyfiles
  557.     (source "ENV:Sys/def_amigaguide.info")
  558.     (dest @default-dest)
  559.     (newname "Miami.guide.info")
  560.    )
  561.   )
  562.   (if (exists "ENV:Sys/def_ascii.info")
  563.    (copyfiles
  564.     (source "ENV:Sys/def_ascii.info")
  565.     (dest @default-dest)
  566.     (newname "CHANGES.info")
  567.    )
  568.   )
  569.  ))
  570. ))
  571.  
  572. (complete 85)
  573.  
  574. (P-set-tooltypes)
  575.  
  576. (complete 90)
  577.  
  578. (P-set-envvars)
  579.  
  580. (complete 95)
  581.  
  582. (P-add-to-startup)
  583.  
  584. (complete 100)
  585.  
  586. (exit "The installation of Miami is finished. If you are "
  587.  "upgrading from an earlier version of Miami then you need "
  588.  "to shut down Miami and execute the Shell command `avail flush'"
  589.  "or reboot your computer before starting Miami 3.2b.")
  590.